﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Autofac.Integration.Mvc;

namespace EventManager.Resolver
{
    public class IocConfig
    {
        public static IContainer Resolve<T>()
        {
            var container = new ContainerBuilder();

            container.RegisterControllers(typeof(T).Assembly);
            container.RegisterModule(new RepositoryModule());
            container.RegisterModule(new ServicesModule());
            return container.Build();
        }
    }
}
